<?php
/**
 * Abstract class for plugins type of <i>Psa_Plugin_After_User_Authorize</i>.
 * 
 * LICENSE:
 * 
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with This library. If not, see <{@link http://www.gnu.org/licenses/}>.
 *
 * @link http://code.google.com/p/phpstartapp/
 * @author Bojan Mauser <bmauser@gmail.com>
 * @copyright Bojan Mauser 2009
 * @package psa
 * @subpackage plugins
 * @version $Id: Psa_Plugin_After_User_Authorize.class.php 464 2009-03-24 00:30:12Z bmauser $
 */


/**
 * Abstract class for plugins type of <i>Psa_Plugin_After_User_Authorize</i>.
 * After user is successfully authorized with {@link Psa_User::authorize() authorize()} method of the {@link Psa_User} object, 
 * {@link psa_main()} method of the plugin object that extends this class will be called.
 * You can write <i>After_User_Authorize</i> plugins by extending this class. Here is an example:
 * 
 * <code>
 * <?php
 * class my_plugin extends Psa_Plugin_After_User_Authorize{
 * 	
 * 	// you have to define psa_main() method in your child class
 * 	function psa_main($user){
 * 		
 * 		// set some property to authorized user
 * 		$user->favorite_background_color = 'white';
 * 		// you can put here some more logic if you need
 * 	}
 * }
 * ?>
 * </code>
 * 
 * When this example plugin is registered every authorized user will have property called
 * <kbd>favorite_background_color</kbd> with value '<kbd>white</kbd>'.
 * 
 * @see Psa_User
 * @see Psa_User::authorize()
 */
abstract class Psa_Plugin_After_User_Authorize extends Psa_Plugin_Model{
	
	/**
	 * This method will be called after user is successfully authorized with {@link Psa_User::authorize() authorize()} 
	 * method of the {@link Psa_User} object.
	 * @param Psa_User $user_object reference to the {@link Psa_User} object whose {@link Psa_User::authorize() authorize()} method is invoked
	 * @see Psa_User::authorize()
	 */
	abstract protected function psa_main($user_object);
}
